package com.example.bbang.common;

import lombok.Data;

@Data
public class CommonResult<E> {
    private Integer code;
    private String msg;

    private E data;

    private CommonResult(){

    }


    public CommonResult( Integer code, String msg, E data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    public static CommonResult  ok( Object obj){
        return new CommonResult(200,"操作成功",obj);
    }

    public static CommonResult  noOk( Object obj){
        return new CommonResult(400,"操作失败",obj);
    }
}
